<!--
	此示例下载自 https://echarts.apache.org/examples/zh/editor.html?c=pie-alignTo
-->
<!DOCTYPE html>
<html lang="en" style="height: 100%">
<head>
  <meta charset="utf-8">
  <title>车辆管理系统基本数据饼状图</title>
  <style>
    body{
            margin: 0 auto;
            width: auto;
            background-repeat: no-repeat;
            /* background-image: url("static/15.jpg"); */
            /* background-image: url('/static/109.jpg'); */
            background-color:  rgba(163, 163, 246, 0.3);
            background-attachment:fixed;
            background-size:cover;
            background-position:center;
        }
    a{
            margin: 2px;
            padding: 6px 15px;
            border: 5px solid rgba(255, 150, 150, 0.3);
            text-align: center;
            background-color: rgba(243, 75, 75, 0.3);
            color: rgb(255, 255, 255);
            font-weight: 1000;
            border-radius: 20px;
            text-decoration:aliceblue;
        }
  </style>
</head>
<body style="height: 100%; margin: 0">
  <br>
  <a href="/carStockList">返回</a>
  <div id="container" style="height: 90%"></div>

  
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/5.6.0/files/dist/echarts.min.js"></script>
  
  <!-- Uncomment this line if you want to dataTool extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/5.6.0/files/dist/extension/dataTool.min.js"></script>
  -->
  <!-- Uncomment this line if you want to use gl extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-gl/2/files/dist/echarts-gl.min.js"></script>
  -->
  <!-- Uncomment this line if you want to echarts-stat extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-stat/latest/files/dist/ecStat.min.js"></script>
  -->
  <!-- Uncomment this line if you want to echarts-graph-modularity extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-graph-modularity/2/files/dist/echarts-graph-modularity.min.js"></script>
  -->
  <!-- Uncomment this line if you want to use map
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/4.9.0/files/map/js/world.js"></script>
  -->
  <!-- Uncomment these two lines if you want to use bmap extension
  <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=YOUR_API_KEY"></script>
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/5.6.0/files/dist/extension/bmap.min.js"></script>
  -->

  <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript">
$.ajax({
type:"GET",
url:"http://192.168.47.133/barChartData",
dataType:"json",
success:function(data1){
    var dom = document.getElementById('container');
    var myChart = echarts.init(dom, null, {
      renderer: 'canvas',
      useDirtyRect: false
    });
    var app = {};
    
    var option;

    const data = data1;
option = {
  title: [
    {
      text: '车辆管理系统基本数据饼状图',
      left: 'center'
    },
    {
      subtext: '车辆调用情况',
      left: '16.67%',
      top: '85%',
      textAlign: 'center'
    },
    {
      subtext: '车辆类型分布情况',
      left: '50%',
      top: '85%',
      
      textAlign: 'center'
    },
    {
      subtext: '工作人员类型分布情况',
      left: '83.33%',
      top: '85%',
      
      textAlign: 'center'
    }
  ],
  series: [
    {
      type: 'pie',
      radius: '60%',
      center: ['50%', '50%'],
      data: data["data1"],
      label: {
        position: 'outer',
        alignTo: 'none',
        bleedMargin: 5
      },
      left: 0,
      right: '66.6667%',
      top: 0,
      bottom: 0
    },
    {
      type: 'pie',
      radius: '60%',
      center: ['50%', '50%'],
      data: data['data2'],
      label: {
        position: 'outer',
        alignTo: 'labelLine',
        bleedMargin: 5
      },
      left: '33.3333%',
      right: '33.3333%',
      top: 0,
      bottom: 0
    },
    {
      type: 'pie',
      radius: '60%',
      center: ['50%', '50%'],
      data: data['data3'],
      label: {
        position: 'outer',
        alignTo: 'edge',
        margin: 20
      },
      left: '66.6667%',
      right: 0,
      top: 0,
      bottom: 0
    }
  ]
};

    if (option && typeof option === 'object') {
      myChart.setOption(option);
    }

    window.addEventListener('resize', myChart.resize);
  }
});
</script>
</body>
</html>